<template>
	<view class="hb-page">
		<u-navbar bgColor="#F25745" titleStyle="color:#fff" title="红包收益" leftIconColor="#fff" :autoBack="true"
			:placeholder="true">
		</u-navbar>
		<view class="head-box">
			<image :src="info.user.u_img" mode=""></image>
			<view>{{info.user.name}}共收到</view>
		</view>
		<view class="number">
			<text>{{info.total_amount}}</text>云矿石
		</view>
		<view class="fun-box">
			<view class="title-box">
				<view class="num">{{info.total_packets}}</view>
				<view class="title">收到红包</view>
			</view>
			<view class="title-box">
				<view class="num">{{info.best_luck_count}}</view>
				<view class="title">手气最佳</view>
			</view>
		</view>
		<view style="margin-top: 80rpx;"></view>
		<view class="list-box">
			<view class="list" v-for="(item,index) in info.grab_records" :key="index">
				<view class="left-box">
					<view class="title">{{item.creat_name}}</view>
					<view class="time">{{$u.timeFormat(item.grab_time, 'mm月dd日')}}</view>
				</view>
				<view class="right-box">
					<view>{{item.grab_amount}} 云矿石</view>
					<view class="best" v-if="item.is_best_luck == 1">
						<image src="/static/chat/hg.png" mode=""></image>
						<view>手气最佳</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		onLoad() {
			this.countpost()
		},
		methods: {
			countpost() {
				let params = {

				}
				this.$Request({
					method: 'POST',
					url: '/api/luckys/countMyRedPackets',
					data: params
				}).then(res => {
					if (res.code == 1) {
						this.info = res.data
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.hb-page {
		width: 100%;
		height: 100vh;
		background-repeat: no-repeat;
		background-size: 100% 222rpx;
		background-color: #17191A;

		.head-box {
			text-align: center;
			color: #EBCD9A;
			font-size: 32rpx;
			margin-top: 130rpx;

			image {
				width: 116rpx;
				height: 116rpx;
				border-radius: 10rpx;
				margin-bottom: 20rpx;
			}

		}

		.number {
			text-align: center;
			font-weight: 500;
			font-size: 28rpx;
			color: #D0D0D0;
			margin-top: 48rpx;
			text{
				font-size: 100rpx;
			}
		}

		.list-box {
			background-color: #1b1d1f;
			min-height: 50vh;

			.list {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 20rpx 30rpx;
				border-bottom: 1rpx solid #34383b;

				.left-box {
					.title {
						font-weight: 400;
						font-size: 32rpx;
						color: #FFFFFF;
					}

					.time {
						font-weight: 400;
						font-size: 24rpx;
						color: #878787;
						margin-top: 10rpx;
					}
				}

				.right-box {
					color: #fff;
					font-size: 28rpx;
					text-align: right;
				
					.best {
						margin-top: 10rpx;
						font-size: 24rpx;
						display: flex;
						align-items: center;
						justify-content: right;
						color: #c6c6c6;
						
						image {
							width: 27.49rpx;
							height: 23.77rpx;
							margin-right: 10rpx;
						}
					}
				}
			}
		}

		.fun-box {
			display: flex;
			align-items: center;
			margin-top: 40rpx;

			.title-box {
				width: 50%;
				text-align: center;

				.num {
					font-weight: 500;
					font-size: 60rpx;
					color: #878787;
				}

				.title {
					font-weight: 400;
					font-size: 28rpx;
					color: #878787;
					margin-top: 10rpx;
				}
			}
		}
	}
</style>